package libs.game.sokoban;

import libs.game.Coordinates;
import libs.game.Solution;

/**
 *              This class represents a sokoban solution.
 *
 * @author      Jan Papousek
 * @version     2009-03-12
 */
public class SokobanSolution implements Solution {

    private boolean solved;

    public SokobanSolution(SokobanGamePlan gamePlan) {
        solved = true;
        for (Coordinates goal: gamePlan.getGoals()) {
            if (gamePlan.getField(goal) != SokobanGamePlan.FIELD_BOX_ON_GOAL) {
                solved = false;
            }
        }
    }

    @Override
    public boolean isSolved() {
        return solved;
    }

}
